/**
*      author: Y_Yao
*      created: 2024-10-20 12:23:39
**/

#include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;
const int INF = 0x3f3f3f3f;
const double pi = 3.1415926535897932;
const double eps = 1e-8;
const int N = 1e4 + 7;
double a[N];
int n,f;

bool check(double mid)
{
    int ret = 0;
    for(int i = 1;i <= n;i++)
    {
        ret += (int)(a[i] / mid);
    }

    if(ret >= f + 1) return true;
    else return false;
}

void solve()
{
    scanf("%d %d",&n,&f);
    double sum = 0;
    for(int i = 1;i <= n;i++)
    {
        scanf("%lf",&a[i]);
        a[i] *= a[i];
        sum += a[i];
    }

    double l = 0,r = sum / (f + 1);
    while(r - l > eps)
    {
        double mid = (r + l) / 2;
        if(check(mid))
            l = mid;
        else 
            r = mid;
    }

    double ans = pi * l;
    printf("%.4lf\n",ans);
}


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 0;
    scanf("%d",&t);
    while(t--)
    {
        solve();
    }
    return 0;
}
